package com.syezon.wifikey.speedup;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import com.syezon.wifikey.home.ResultHelper;

public class SpeedUpHelper {

    public static void speedUp(Context context, String ssid, int initScore, int addPercent) {
        if (initScore >= 97) {
            ResultHelper.showSpeedUpResult(context, 100);
        } else {
            Intent intent = new Intent(context, SpeedUpActivity.class);
            intent.putExtra(SpeedUpActivity.ARG_SSID, ssid);
            intent.putExtra(SpeedUpActivity.ARG_ADD_PERCENT, addPercent);
            intent.putExtra(SpeedUpActivity.ARG_INIT_SCORE, initScore);
            if (!(context instanceof Activity)) {
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            }
            context.startActivity(intent);
        }

    }
}
